package com.lzl.web.interceptors;

/*import com.lzl.entity.SysUser;
import com.lzl.utils.Constants;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.HandlerInterceptor;

public class AuthInterceptor implements HandlerInterceptor {
    private static final Logger LOGGER = LoggerFactory.getLogger(AuthInterceptor.class);

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception{
        LOGGER.debug("进入自定义拦截器AuthInterceptor，请求路径： {}",request.getRequestURI());
        HttpSession session = request.getSession();
        SysUser sysUser = (SysUser)session.getAttribute(Constants.SESSION_USER);
        if (null == sysUser) {
            request.getRequestDispatcher("/WEB-INF/jsp/401.jsp").forward(request, response);
            return false;
        }
        return true;
    }
}*/
